#name = raw_input("what is your name?\n")
#print "Hello," + name + "!"
#"hello"
#raw = raw_input("what is  your id ")
#print "raw" +raw
monthName = [
	'January',
	'February',
	'March',
	'April',
	'May',
	'June',
	'July',
	'August',
	'September',
	'October',
	'nOvember',
	'December'
]

ending = ['ST','ND','RD'] + 17 * ['TH'] +['ST','ND','RD']\
		 +7 * ['TH'] + ['ST']

year = raw_input("please input the year :")
month = raw_input("please input the month:")
day = raw_input("please input the day:")

month_Num = int(month)
day_Num = int(day)

day_Name = day + ending[day_Num - 1]
month_Name = monthName[month_Num - 1]

print month_Name+ " " + day_Name + " " + year
